package top.luckyluxcis.util;

import lombok.experimental.UtilityClass;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * @author Zhuang
 * @since 2023/9/21
 */
@UtilityClass
public class MapUtil {

    public static <K, V> MapBuilder<K, V> builder() {
        return new MapBuilder<>();
    }
    public static <K,V> Map<K,V> empty(){
        return MapUtil.<K,V>builder().build();
    }

    public static class MapBuilder<K, V> {
        private final Map<K, V> map = new HashMap<>();

        public MapBuilder<K, V> put(K key, V value) {
            map.put(key, value);
            return this;
        }

        public Map<K, V> build() {
            return map;
        }
    }
}
